<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录页面</title>
		<link rel="stylesheet" href="css/bootstrap.min.css"/>
	</head>
	<body>
		<div class="container" style="width: 300px;margin-top:50px ;">
			<fieldset>
				<legend>登录</legend>
				<div class="form-group">
					<label class="username">用户名:</label>
					<input class="form-control" type="text" 
					autocomplete="off"
					name="username" id="username">
				</div>
				<div class="form-group">
					<label class="password">密码:</label>
					<input class="form-control" type="password" name="password" id="password"/>
				</div>
				<div class="form-group">
					<!-- oncelick事件,单击触发,里面函数,自定义这两个函数js -->
					<button class="btn btn-primary" onclick="save()">保存</button>
					<button class="btn btn-danger" onclick="jsclear()">取消</button>
				</div>
			</fieldset>
		</div>
	</body>
	<script type="text/javascript">
		function save(){
			let username=document.getElementById("username");
			console.log(username);
			let password=document.getElementById("password");
			console.log(password);
		}
		function jsclear(){
			console.log("clear 123");
			document.getElementById("username").value='';
			document.getElementById("password").value="";
		}
	</script>
</html>
